package com.liusaidh.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author liusaidh
 * @date 2024/6/10 20:01
 * @description
 */
@ApiModel(value = "用户修改信息表单类")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UpdateFormDTO {
    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别", name = "sex")
    private Character sex;
    @Min(value = 0,message = "年龄大于0")
    @Max(value = 120,message = "年龄小于120")
    @NotNull(message = "年龄不能为空")
    @ApiModelProperty(value = "年龄", name = "age")
    private Integer age;
    @NotNull(message = "用户名不能为空")
    @Size(min = 1,max = 15,message = "用户名长度在1-15之间")
    @ApiModelProperty(value = "用户名", name = "username")
    private String username;
    @NotNull(message = "地址不能为空")
    @ApiModelProperty(value = "地址", name = "address")
    private String address;
    @NotNull(message = "标签不能为空")
    @Size(min = 1,max = 15,message = "标签用1-20个字符")
    @ApiModelProperty(value = "标签", name = "label")
    private String label;
    @Override
    public String toString() {
        return "UserDTO{" +
                "sex=" + sex +
                ", age=" + age +
                ", username='" + username + '\'' +
                ", address='" + address + '\'' +
                ", label='" + label + '\'' +
                '}';
    }
}
